package com.idanchuang.component.base;

import com.idanchuang.component.base.aspect.WhenPressureAspect;
import com.idanchuang.component.core.config.EnvConfigBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author yjy
 * @date 2020/7/6 10:49
 **/
@Configuration
public class ComponentBasePressureAutoConfiguration {

    @Bean("pressureConfigBean")
    @ConfigurationProperties(prefix = "idanchuang.component.core.pressure")
    public EnvConfigBean pressureConfigBean() {
        return new EnvConfigBean();
    }

    @Bean
    @ConditionalOnMissingBean
    public WhenPressureAspect whenPressureAspect() {
        return new WhenPressureAspect();
    }


}
